package com.mew.chess.core.game.yxx.game.message;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.*;

import java.util.List;


/**
 * 开始押注
 */
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class YxxPushStartGameMessage extends ZebraBaseMessage<YxxPushStartGameMessage> {

    private int remainTime;
    private long ino;

    private List<YxxUserMessage> bigRList;

    @Override
    public void write(ByteBuf b) {

        writeInt(b, this.remainTime);
        writeLong(b, this.ino);

        writeInt(b,bigRList.size());

        for (YxxUserMessage yxxUserMessage : bigRList) {
            yxxUserMessage.write(b);
        }

    }

    @Override
    public YxxPushStartGameMessage read(ByteBuf b) {
        this.remainTime = readInt(b);
        return this;
    }
}
